﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace PaliTextReader2
{
    public partial class BookSettingsDlg : Form
    {
        private int m_nFileID;

        public BookSettingsDlg()
        {
            InitializeComponent();
        }

        public BookSettingsDlg(int FileID)
        {
            InitializeComponent();
            m_nFileID = FileID;
        }

        private void BookSettingsDlg_Load(object sender, EventArgs e)
        {
            ContentsDS.FilesDataTable objFiles = m_objFilesTA.GetByFileID(m_nFileID);
            if (objFiles.Rows.Count > 0)
            {
                ctlApplyBold.Checked = objFiles[0].ShowBold;
                ctlApplyFont.Checked = objFiles[0].ShowFont;
            }
        }

        private void ctlOK_Click(object sender, EventArgs e)
        {
            m_objFilesTA.UpdateFlags(ctlApplyBold.Checked, ctlApplyFont.Checked, m_nFileID);

            DialogResult = DialogResult.OK;
        }
    }
}
